package com.smh.a04DateUtilDemo4;

import java.time.Duration;
import java.time.LocalTime;

public class DurationDemo1 {
    public static void main(String[] args) {

        LocalTime now = LocalTime.now();
        System.out.println(now);

        LocalTime close = LocalTime.of(10,30,0);
        System.out.println(close);

        //比较精确
        //第二个参数见第一个参数
        Duration duration = Duration.between(close,now);

        System.out.println(duration);
        System.out.println(duration.toDays());
        System.out.println(duration.toHours());
        System.out.println(duration.toMinutes());
        System.out.println(duration.toSeconds());
        System.out.println(duration.toMillis());
        System.out.println(duration.toNanos());

    }
}
